import fetch from '../utils/fetch'

export function loginApi(params) {
  return fetch({
    url: '/liukeyi/weixin/oauth2user',
    method: 'get',
    params
  })
}

export function updateMemberApi(params) {
  return fetch({
    url: '/liukeyi/inf/infUser/getUser',
    method: 'get',
    params
  })
}

export function initWeChatApi(url) {
  // console.info('location.href.split(\'#\')', location.href.split('#'))
  return fetch({
    url: '/liukeyi/weixin/jsTicket',
    method: 'get',
    params: { url: url || location.href.split('#')[0] }
  })
}

export function weChatPayApi(params) {
  return fetch({
    url: '/liukeyi/weixin/pay',
    method: 'get',
    params
  })
}

export function getSwiperApi(params) {
  return fetch({
    url: '/liukeyi/inf/infPic/picTo',
    method: 'get',
    params
  })
}
